# -*- coding: utf-8 -*-
"""
事件类。

:author: 宋文武
:date: 2016-11-10
"""
import attr
from zope.interface import implementer
from pyshare.bll import intfs


@attr.s
class Event(object):
    """事件。"""
    context = attr.ib({})


@implementer(intfs.IIndicatorsChanged)
@attr.s
class IndicatorsChanged(Event):
    """国家指标已变更。"""
    role_id = attr.ib(None)
    indicators = attr.ib(None)


@implementer(intfs.IRoleDungeonPointPass)
@attr.s
class RoleDungeonPointPass(Event):
    """角色副本据点胜利"""
    role_id = attr.ib(None)
    progress = attr.ib(None)
    # battle_score = attr.ib(None)


@implementer(intfs.IRoleDrillPointChanged)
@attr.s
class RoleDrillPointChanged(Event):
    """角色校场分数变更"""
    role_id = attr.ib(None)
    drill_point = attr.ib(None)


@implementer(intfs.IActivityProgressChanged)
@attr.s
class ActivityProgressChanged(Event):
    """活动进度变更。"""
    role_id = attr.ib(None)
    a_type = attr.ib(None)
    add_value = attr.ib(None)
    battle_score = attr.ib(None)
    level_id = attr.ib(None)
    alliance_id = attr.ib(None)
    specific_id = attr.ib(None)


@implementer(intfs.IConcubineIntimateChanged)
@attr.s
class IntimateChanged(Event):
    """亲密度变更"""
    role_id = attr.ib(None)
    intimate_lv = attr.ib(None)


@implementer(intfs.IRoleRecharge)
@attr.s
class RoleRecharge(Event):
    """用户充值"""
    role_id = attr.ib(None)
    money = attr.ib(None)
    product_id = attr.ib(None)


@implementer(intfs.IRoleBehaviorChanged)
@attr.s
class RoleBehaviorProgressChanged(Event):
    """角色行为事件变更"""
    role_id = attr.ib(None)
    behavior_type = attr.ib(None)
    add_value = attr.ib(None)


@implementer(intfs.ISiegelordBehaviorChanged)
@attr.s
class SiegelordBehaviorChanged(Event):
    """攻城略地角色行为事件变更"""
    siegelord_role = attr.ib(None)
    behavior_type = attr.ib(None)
    add_value = attr.ib(None)


@implementer(intfs.ITowerBehaviorChanged)
@attr.s
class TowerBehaviorChanged(Event):
    """爬塔行为事件变更"""
    tower_role = attr.ib(None)
    behavior_type = attr.ib(None)
    template_id = attr.ib(None)
    add_value = attr.ib(None)
